package com.globefrog.framework.common.exception;

import java.util.UUID;

/**
 * @author : caijinbang
 * @date : Create in 2021/5/21
 */
public class BusinessException extends RuntimeException {

  private static final long serialVersionUID = -6568291791621559263L;
  private int errorCode;
  private String token = UUID.randomUUID().toString();

  public BusinessException(int code, String s) {
    super(s);
    this.errorCode = code;
  }

  public BusinessException() {
  }

  public BusinessException(int code, String message, Throwable cause) {
    super(message, cause);
    this.errorCode = code;
  }

  public BusinessException(Throwable cause) {
    super(cause);
  }

  public int getErrorCode() {
    return this.errorCode;
  }

  public void setErrorCode(int errorCode) {
    this.errorCode = errorCode;
  }

  public String getToken() {
    return this.token;
  }

  public void setToken(String token) {
    this.token = token;
  }

}
